import time
from _ast import Str

t=time.localtime().__getattribute__("tm_year")
print(t)

for c in 'sample':
    print(c.upper())
    
s='TEST'
print(s.lower())

#迭代
sqr=[x **2 for x in[1,2,3,4,5,6]]
print(sqr)

#没有键值检查
D={'a':'alph','b':'beta','c':'case'}
print(D['f'])
    
#键值测试,避免不存在时出错
D={'a':'alph','b':'beta','c':'case'}
if 'd' in D:
    print('字典存在d')
elif 'd' not in D:
    print('字典不存在d')
    
